package com.memexue.order.message;

import org.springframework.cloud.stream.annotation.Input;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.SubscribableChannel;

/**
 * 定义input和output
 */
public interface StreamClient {
    String INPUT = "inputMsg";
    String OUTPUT = "outputMsg";

    /**
     * 相当于消费者consumer，从队列中接收消息
     * @return
     */
    @Input(StreamClient.INPUT)
    SubscribableChannel input();

    /**
     * 相当于生产者producer，从队列中发送消息
     * @return
     */
    @Output(StreamClient.OUTPUT)
    MessageChannel output();
}
